// routes/categoryRoutes.js
const express = require('express');
const { 
  getCategoriesByShop, 
  getDishesByCategory,
  getAllDishesByShop
} = require('../controllers/categoryController');
const { auth } = require('../middleware/auth');

const router = express.Router();

// 应用认证中间件
router.use(auth);

// 获取店铺的菜品分类
router.get('/shop/:shopId/categories', getCategoriesByShop);

// 获取分类下的菜品
router.get('/shop/:shopId/categories/:categoryId/dishes', getDishesByCategory);

// 获取店铺的所有菜品（按分类分组）
router.get('/shop/:shopId/dishes', getAllDishesByShop);

module.exports = router;